/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>

*/
package cmd

import (
	"fmt"

	"gitee.com/lys_billy/bpf-map/pkg/bpf"
	"github.com/spf13/cobra"
)

// removeCmd represents the remove command
var removeCmd = &cobra.Command{
	Use:   "remove",
	Short: "bpf-map remove --name=mapname remove map",
	Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:

Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
	Run: func(cmd *cobra.Command, args []string) {
		mapname, _ := cmd.Flags().GetString("name")
		bpf.RemoveMap(mapname)
		fmt.Printf("remove map  name is %v !\n", mapname)
	},
}

func init() {
	rootCmd.AddCommand(removeCmd)
	removeCmd.Flags().StringP("name", "n", "cilium-test-map", "--name=test")
}
